<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旋转木马案例</title>
    <style>
        body {
            perspective: 1000px;
        }
        
        main {
            width: 280px;
            height: 180px;
            margin: 200px auto;
            position: relative;
            transform-style: preserve-3d;
            animation: rotate 12s linear 2s infinite;
            background: pink;
        }
        
        @keyframes rotate {
            100% {
                transform: rotateY(360deg);
            }
        }
        
        div {
            width: 100%;
            height: 100%;
            background-color: pink;
            position: absolute;
        }
        
        div:nth-child(1) {
            transform: translateZ(400px);
        }
        
        div:nth-child(2) {
            transform: rotateY(60deg) translateZ(400px);
        }
        
        div:nth-child(3) {
            transform: rotateY(120deg) translateZ(400px);
        }
        
        div:nth-child(4) {
            transform: rotateY(180deg) translateZ(400px);
        }
        
        div:nth-child(5) {
            transform: rotateY(240deg) translateZ(400px);
        }
        
        div:nth-child(6) {
            transform: rotateY(300deg) translateZ(400px);
        }
    </style>
</head>

<body>
    <main>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </main>
</body>

</html>